<?php 
include $_SERVER['DOCUMENT_ROOT'] . '/paths.php';

function getNavBar($active)
{
  global $PATH_TUTORIALS;
  global $PATH_OPENGL;
  global $PATH_CONTENT;
  
  $home_active = ($active == 0 ? 'active' : '');
  $tuts_active = ($active == 1 ? 'active' : '');
  $about_active = ($active == 2 ? 'active' : '');
  
  $navbar = '
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
    
        <!-- Navbar header -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse"
            data-target="#top-nav">
            <span class="sr-only">Toggle navigation</span> <span
              class="icon-bar"></span> <span class="icon-bar"></span> <span
              class="icon-bar"></span>
          </button>
          <!-- Navbar brand -->
          <a class="navbar-brand" href="/">Graphiclicious</a>
        </div>
    
        <div class="collapse navbar-collapse" id="top-nav">
          <!-- Navbar left -->
          <ul class="nav navbar-nav">
    
            <!--  Home -->
            <li class="' . $home_active . '"><a href="' . $PATH_CONTENT . '">Home</a>
            </li>
    
            <!-- Tutorials -->
            <li class="' . $tuts_active . '"><a
              class="dropdown-split-left"
              href="' . $PATH_TUTORIALS . '"> Tutorials </a></li>
            <li class="' . $tuts_active . '"><a href="#"
              class="dropdown dropdown-split-right" data-toggle="dropdown">
                <b class="caret"></b>
            </a>
              <ul class="dropdown-menu">
                <li><a href="' . $PATH_OPENGL . '"> OpenGL </a></li>
              </ul></li>
          </ul>
    
          <!-- Navbar right -->
          <ul class="nav navbar-nav navbar-right">
            <!-- About -->
            <li class="dropdown ' . $navbar_about_active . '"><a
              href="/about.php">About</a></li>
          </ul>
        </div>
      </div>
    </nav>  
  ';
  return $navbar;
}
